package day0717;

import java.util.Scanner;

public class Test9 {
    public static void main(String[] args) {
        //输入一个月份儿值，
        Scanner  sa=new Scanner(System.in);
        System.out.println("请输入一个月份");
        int month=sa.nextInt();
        System.out.println("请输入一个年份");
        int year=sa.nextInt();
        while(1<=month  &&  month<=12) {
            //用if-else if判断这个月有多少天
            if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
                System.out.println(year + "年" + month + "是31天");
            } else if (month == 4 || month == 6 || month == 9 || month == 11) {
                System.out.println(year + "年" + month + "是30天");
            } else {
                if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {
                    System.out.println(year + "年" + month + "是29天");
                } else {
                    System.out.println(year + "年" + month + "是28天");
                }
            }
            //再次输入年份和月份
            System.out.println("请输入一个月份");
            month=sa.nextInt();
            System.out.println("请输入一个年份");
            year=sa.nextInt();
        }
        //1 3 5 7 8 10 12 都是31天
        //4 6 9 11   都是30天
    }
}
